package com.example.demo.mapper;

import com.example.demo.entity.ArticleInfo;
import com.example.demo.entity.vo.ArticleInfoVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.HashSet;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: DELL
 * Date: 2023-05-28
 * Time: 8:15
 */
@Mapper
public interface ArticleMapper {
    ArticleInfoVO getDetailArticle(@Param("id") Integer id);

    List<ArticleInfoVO> getAllArticleByUserId(@Param("id") Integer id);

    // 根据 id 和 title 来筛选文章
    List<ArticleInfoVO> getArticleByIdAndTitle(@Param("id") Integer id, @Param("title") String title);

    // 根据 id 修改指定文章
    int updateById(ArticleInfo articleInfo);

    // 删除指定 uid 的全部文章
    int deleteByUid(List<Integer> list);

}
